package top.lidee.repository.model.twice.vo.management;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.URL;
import top.lidee.repository.model.MtGoodsSpec;
import top.lidee.repository.validator.groups.Add;
import top.lidee.repository.validator.groups.Update;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;

/**
 * @author 张一恒
 * @version 1.0
 * @description:
 * @date 2024/9/28 02:34
 */
@Data
public class SaveOrUpdateGoodsAppletVo {

    @ApiModelProperty("商品skuId")
    @NotNull(message = "商品skuId不能为空", groups = Update.class)
    private Integer goodsId;

    @ApiModelProperty("店铺id")
    @NotNull(message = "店铺id不能为空")
    private Integer storeId;

    @ApiModelProperty("商品名称")
    @NotBlank(message = "商品名称不能为空")
    private String name;

    @ApiModelProperty("是否单规格(0：是；1：不是)")
    @NotBlank(message = "请选择是否单规格")
    private String isSingleSpec;

    @ApiModelProperty("商品规格")
    private List<MtGoodsSpec> specs;

    @ApiModelProperty("主图地址(log地址)")
    @URL(message = "主图地址错误")
    private String logo;

    @ApiModelProperty("轮播图片地址，多个以逗号（,）分开")
    private String images;

    @ApiModelProperty("价格")
    @NotNull(message = "价格不能为空")
    private BigDecimal price;

    @ApiModelProperty("划线价格")
    private BigDecimal linePrice;

    @ApiModelProperty("服务时长")
    private Integer serviceTime;

    /*@ApiModelProperty("可否使用积分抵扣")
    private String canUsePoint;*/

    /*@ApiModelProperty("会员是否有折扣")
    private String isMemberDiscount;*/

    @ApiModelProperty("商品排序")
    private Integer sort;

    @ApiModelProperty("商品描述")
    private String description;

    public static class Constant {
        /**
         * 是否单规格(0：是；1：不是)
         */
        public static final String ONE_SINGLESPEC = "0";
        public static final String MORE_SINGLESPEC = "1";
    }

}
